class CreateVotes < ActiveRecord::Migration
  def self.up
    create_table :votes do |t|
      t.column :user_id, :integer # Can't be empty. Only logon user can vote for a novel or fragment
      t.column :fragment_id, :integer # Can be null. Vote can be poll for novel or fragment
      t.column :novel_id, :integer #Can be null. Vote can be poll for novel or fragment
      t.column :level, :integer #Vote level. for fragment 1 means good, -1 means bad, -2 means much bad.
      t.timestamps
    end
  end

  def self.down
    drop_table :votes
  end
end
